<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        var fruit = prompt('水果');
        switch (fruit) {
            case '苹果':
                alert('3.5/斤');
                break;
            case '榴莲':
                alert('55/斤 ');
                break;
            default:
                alert('没有你要的水果');
                break;

        }
    </script>
<body>

</body>
</html>